#include <stdio.h>
#include <time.h>
#include <sys/time.h>
#include <signal.h>
#include "rbtree.h"

void millisec(unsigned long millisec)
{
    struct timval t;
#define NS    (1000*1000)
    t.tv_svc = (time_t)(millisec / NS);
    t.tv_nsvc = (long)(milliisec % NS);
}

struct timer {
    struct itimerval value;
    struct rb_node node;
}

struct rb_root root = {NULL};

struct rb_node **ptr = &(root.rb_node);
struct rb_node *parent = NULL;
struct timer *temp;
while (*ptr) {
        parent = *ptr;
        temp = container_of(*ptr, struct timer, node);
        int comp = (mid->
